package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jackrabbit.j2ee.SimpleWebdavServlet;
import java.net.URI;
import org.apache.jackrabbit.util.Text;

public final class webdav_002dsimple_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.List _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.AnnotationProcessor _jsp_annotationprocessor;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
  }

  public void _jspDestroy() {
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;


request.setAttribute("title", "Standard WebDAV Server");

URI uri = new URI(request.getRequestURL().toString());
String href =
    uri.getScheme() + "://" + uri.getHost() + ":" + uri.getPort()
    + request.getContextPath()
    + SimpleWebdavServlet.getPathPrefix(pageContext.getServletContext())
    + "/default/";
href = Text.encodeIllegalXMLCharacters(href);

      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "header.jsp", out, false);
      out.write("\r\n");
      out.write("\r\n");
      out.write("<p>\r\n");
      out.write("  The default WebDAV server (aka: Simple Server) is a\r\n");
      out.write("  <a href=\"http://www.ietf.org/rfc/rfc2518.txt\">DAV 1,2</a> and\r\n");
      out.write("  <a href=\"http://www.ietf.org/rfc/rfc3253.txt\">DeltaV</a>\r\n");
      out.write("  compliant WebDAV  server implementation. It offers a file-based view to\r\n");
      out.write("  the JCR repository, suitable  for everybody looking for standard WebDAV\r\n");
      out.write("  functionality. Essentially, the contents of the underlying content\r\n");
      out.write("  repository are exposed as a hierarchical collection of files and folders.\r\n");
      out.write("<p>\r\n");
      out.write("\r\n");
      out.write("<h3>Access the content repository</h3>\r\n");
      out.write("<p>\r\n");
      out.write("  Use the following URL to access the content repository in your WebDAV client:\r\n");
      out.write("</p>\r\n");
      out.write("<ul>\r\n");
      out.write("  <li><a href=\"");
      out.print( href );
      out.write('"');
      out.write('>');
      out.print( href );
      out.write("</a></li>\r\n");
      out.write("</ul>\r\n");
      out.write("<p>\r\n");
      out.write("  The server asks for authentication, but by default any username and password\r\n");
      out.write("  is accepted. You can modify this security policy in the repository\r\n");
      out.write("  configuration file.\r\n");
      out.write("</p>\r\n");
      out.write("<p>\r\n");
      out.write("  To access other workspace than the default one, replace the last part of\r\n");
      out.write("  the URL (<code>/default/</code>) with the name of another workspace.\r\n");
      out.write("</p>\r\n");
      out.write("<p>\r\n");
      out.write("  You can also <a href=\"search.jsp\">search</a> the default workspace\r\n");
      out.write("  <a href=\"populate.jsp\">populate</a> it with example content from the\r\n");
      out.write("  Internet.\r\n");
      out.write("</p>\r\n");
      out.write("\r\n");
      out.write("<h3>File system access</h3>\r\n");
      out.write("<p>\r\n");
      out.write("  Many operating systems, including Windows and Mac OS X, allow you to\r\n");
      out.write("  \"mount\" a WebDAV server as a shared network disk. You can use the above\r\n");
      out.write("  URL to make the default workspace available as such a network disk, after\r\n");
      out.write("  which you can use normal file system tools to copy files and folders to\r\n");
      out.write("  and from the content repository.\r\n");
      out.write("</p>\r\n");
      out.write("\r\n");
      out.write("<h3>Supported WebDAV functionality</h3>\r\n");
      out.write("<ul>\r\n");
      out.write("<li><a href=\"http://www.ietf.org/rfc/rfc2518.txt\">RFC 2518</a> (WebDAV 1,2)</li>\r\n");
      out.write("<li><a href=\"http://www.ietf.org/rfc/rfc3253.txt\">RFC 3253</a> (DeltaV)</li>\r\n");
      out.write("<li>Experimental: <a href=\"http://greenbytes.de/tech/webdav/draft-ietf-webdav-bind-latest.html\">draft-ietf-webdav-bind</a> (WebDAV BIND)</li>\r\n");
      out.write("</ul> \r\n");
      out.write("\r\n");
      out.write("<h3>Configuration</h3>\r\n");
      out.write("<ul>\r\n");
      out.write("    <li>Context path: ");
      out.print( Text.encodeIllegalXMLCharacters(request.getContextPath()) );
      out.write("</li>\r\n");
      out.write("    <li>Resource path prefix: ");
      out.print( Text.encodeIllegalXMLCharacters(SimpleWebdavServlet.getPathPrefix(pageContext.getServletContext())) );
      out.write("</li>\r\n");
      out.write("    <li>Servlet configuration: see <i>/WEB-INF/web.xml</i></li>\r\n");
      out.write("    <li>WebDAV specific resource configuration: see <i>/WEB-INF/config.xml</i></li>\r\n");
      out.write("</ul>\r\n");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "footer.jsp", out, false);
      out.write('\r');
      out.write('\n');
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
